/**
 * 
 */
package com.google.code.sip.ucenter.web.admin.controller;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 管理后台菜单
 * 
 * @author Liuye
 * 
 */
@SuppressWarnings("serial")
public class Menu implements Serializable {
	public static Map<String, Menu> adminMenus = new LinkedHashMap<String, Menu>();
	static {
		createAdminMenu();
	}

	private String name;
	private String displayName;
	private String url;
	private boolean selected;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public boolean isSelected() {
		return selected;
	}

	public void setSelected(boolean selected) {
		this.selected = selected;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	private static void createAdminMenu() {
		Menu menu = new Menu();
		menu.setName("home");
		menu.setDisplayName("首页");
		menu.setUrl("/admin/index.do");
		menu.setSelected(true);
		adminMenus.put(menu.getName(), menu);

		menu = new Menu();
		menu.setName("app");
		menu.setDisplayName("应用管理");
		menu.setUrl("/admin/application.do");
		menu.setSelected(false);
		adminMenus.put(menu.getName(), menu);

		menu = new Menu();
		menu.setName("user");
		menu.setDisplayName("用户管理");
		menu.setUrl("/admin/user.do");
		menu.setSelected(false);
		adminMenus.put(menu.getName(), menu);

		menu = new Menu();
		menu.setName("credit");
		menu.setDisplayName("积分管理");
		menu.setUrl("/admin/credit.do");
		menu.setSelected(false);
		adminMenus.put(menu.getName(), menu);
	}
}
